package buka.oversea.aeron5;

import buka.oversea.aeron5.config.ClusterConfig;
import buka.oversea.aeron5.service.BalanceClusteredService;
import io.aeron.cluster.service.ClusteredServiceContainer;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication(scanBasePackages = "buka.oversea")
public class ServiceAeron5Application {

    private static final int NODE_ID = 0;

    public static void main(String[] args) {
        System.setProperty("aeron.dir", "build/aeron/node" + NODE_ID);

        // 1. MediaDriver & Archive & ConsensusModule 用官方脚本或独立 main
        // 2. Spring Boot 仅启动 ServiceContainer
        ClusteredServiceContainer.launch(
                ClusterConfig.serviceContainerCtx(NODE_ID, new BalanceClusteredService())
        );
    }

}
